Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[metal] Pull out the Runtime MSL code into its own module #3086

Merged
merged 3 commits into from
Oct 6, 2021

Conversation

k-ye
Copy link
Member

@k-ye k-ye commented Oct 4, 2021

Related issue = #3018

Decoupling the runtime part from the root/SNodes, so that it is easier for us to support multiple SNode roots.

In prep for the multi-root setup, we cannot know how many SNodes there will be in the system. As a result, we just set a reasonable upper-bound of 1024:

constexpr int taichi_max_num_snodes = 1024;

Unfortunately the sparse runtime part cannot be easily separated into a per-root buffer yet, so all the sparse info (for multiple roots) still share a single global buffer.

@netlify
Copy link

netlify bot commented Oct 4, 2021

✔️ Deploy Preview for jovial-fermat-aa59dc canceled.

🔨 Explore the source changes: c5d7f44

🔍 Inspect the deploy log: https://app.netlify.com/sites/jovial-fermat-aa59dc/deploys/615abcea147626000857b119

@taichi-gardener
Copy link
Contributor

/format

emit(" ListManagerData snode_lists[{}];", max_snodes_);
emit(" NodeManagerData snode_allocators[{}];", max_snodes_);
emit(" NodeManagerData::ElemIndex ambient_indices[{}];", max_snodes_);
emit(" SNodeMeta snode_metas[{}];", kMaxNumSNodes);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How big is kMaxNumSNodes? Will it be a concern in the future

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! This is 1024 now

constexpr int taichi_max_num_snodes = 1024;

Unfortunately the sparse runtime part cannot be easily separated into a per-root buffer yet, so all the sparse info (for multiple roots) still share a single global buffer.

Copy link
Collaborator

@bobcao3 bobcao3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not very familiar with this backend but looks good to me

@k-ye k-ye merged commit 6253b0d into taichi-dev:master Oct 6, 2021
@k-ye k-ye deleted the mtl-runtime branch October 6, 2021 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants